
//
//  AdvertisePlanCell.m
//  PASystem
//
//  Created by 刘沿 on 16/9/19.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "AdvertisePlanCell.h"

@implementation AdvertisePlanCell

+(instancetype)WithAdvertisePlanCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"AdvertisePlanCell" owner:nil options:nil] lastObject];
    
}

- (void)setModel:(AdvertisePlan *)model{
    _model = model;

    self.MEDIANAME.text  = model.MEDIANAME;
    self.TITLE.text = model.TITLE;
    
    //时间戳转时间
    NSString *string = model.DELAYTIME;
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
    fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
    NSDate *date = [fmt dateFromString:string];
    NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
    NSString *selfYear = [fm stringFromDate:date];
    
    self.DELAYTIME.text = selfYear;
    
}


@end
